package com.agentfactory.teleoreactive.interpreter;

import com.agentfactory.platform.core.AgentCreationException;
import com.agentfactory.platform.core.IAgent;
import com.agentfactory.platform.impl.AbstractArchitectureFactory;

public class TeleoReactiveArchitectureFactory extends
		AbstractArchitectureFactory {

	@Override
	public IAgent create(String name, Object design) throws AgentCreationException {
		ScriptBasedTeleoReactiveAgent agent = new ScriptBasedTeleoReactiveAgent(name);
		agent.construct((String)design);
		return agent;
	}

	@Override
	public boolean filter(Object design) {
		 if (String.class.isInstance(design)) {
	            return ((String) design).endsWith(".aftr");
	        }
	        return false;
	}

}
